﻿using System;
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Button))]
public class UIEnableButton : MonoBehaviour
{
    private Button button;
    public GameObject target;

    private void Start()
    {
        this.button = base.GetComponent<Button>();
        this.button.onClick.AddListener(delegate {
            this.target.SetActive(true);
            Animator componentInChildren = this.target.GetComponentInChildren<Animator>();
            if (componentInChildren != null)
            {
                componentInChildren.Play("Enable");
            }
        });
    }
}

